<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>
<style>
    .box{
        width: 100px;
        height: 100px;
        border: 1px solid #333;
    }
</style>
<body>
    <!-- class 和style 用法是一致的 ，同一个标签可以存在多个class属性 -->
    <div id="app">
        <div class="box" :class="isRain?'teal':'blue'">1</div>
        <!-- 属性可以使用对象包裹多个一起写 -->
        <div class="box" :class="{boder:true,blue:true,green:false}">2</div>
        <!-- 也可以在VM中定义属性后，进行引用 -->
        <div class="box" :class="boxClass">3</div>
        <div class="box" :class="boxArr">4</div>
    </div>
    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    isRain:true,
                    boxClass:{border:true,color:true,red:false},
                    boxArr:['red','teal','color']
                }
            }
        })
    </script>
</body>
</html>